UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SBaGzC8bS/CrHHgcmU26Js8Mje6DpONupTn7l7wx2uU=' 
WHERE 
  key_id = 'bc5436a2544a78292bcbdf0a86ddee26f07b7dd978eea772c6a3016303956a49' 
  AND (
    token = 'SBaGzC8bS/CrHHgcmU26Js8Mje6DpONupTn7l7wx2uU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031