UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jmozCjy0zWdZOwFZ9EIGmUOvd9AsqIm10tudTV2Jc9A=' 
WHERE 
  key_id = 'c5cf00336d2b038b7acd9c9b6d45a4ed0bd7d6d4b69389c4b46fd829d21855ab' 
  AND (
    token = 'jmozCjy0zWdZOwFZ9EIGmUOvd9AsqIm10tudTV2Jc9A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026