UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e5AwN/s0gF4r4JocgtzS9qHvhkgmzCCpF5Zn1cHgK8w=' 
WHERE 
  key_id = '66dbb9d2cd0ea6d5ae7079634bb1cdec3a16c997b85a725609dfd63e3b4844a6' 
  AND (
    token = 'e5AwN/s0gF4r4JocgtzS9qHvhkgmzCCpF5Zn1cHgK8w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026