UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vPVVAKPd3YyP+UMsD4gMD/Blwmt9lTu/BmeZ/xUJmlU=' 
WHERE 
  key_id = '5775dc532b563aa805d4c7dbb8b97eca6fab6100a2be0726fe00e863693ed62f' 
  AND (
    token = 'vPVVAKPd3YyP+UMsD4gMD/Blwmt9lTu/BmeZ/xUJmlU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050