UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lyAr9NvHf7m0FbVdWTsNQ61pJD/I+LETM8W8gw/YHBI=' 
WHERE 
  key_id = '494be5716f1bd4c8d8b7243aa4c6c2b0bcaa7a2fc977898ee9aa58a4fd17dd9f' 
  AND (
    token = 'lyAr9NvHf7m0FbVdWTsNQ61pJD/I+LETM8W8gw/YHBI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030