UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0MMNsCNL46W2NkKw8pFNUXtOvyncujoIw1ypPNbjFPk=' 
WHERE 
  key_id = 'c0e0a9337f728809aaadcc94fdb1ae9fadb5b55d29f1093b0d87e85e860c74e6' 
  AND (
    token = '0MMNsCNL46W2NkKw8pFNUXtOvyncujoIw1ypPNbjFPk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023