UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'p347/VMn9UeNk/t29nsOHeYGSvx/l3J0IMofnkOwzrc=' 
WHERE 
  key_id = '07fd91affa7075cd8ad1186ee5d97fb2fde6dbc82a644af607aa94901ac94b56' 
  AND (
    token = 'p347/VMn9UeNk/t29nsOHeYGSvx/l3J0IMofnkOwzrc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024