UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IR0q0h0W0rvZcxdwcfRcqPuBqvX/8Jc9URjEgkKOwcc=' 
WHERE 
  key_id = '07debe439ad2e9b274f4484b021528b34426dd18674e18986556511ac24da13d' 
  AND (
    token = 'IR0q0h0W0rvZcxdwcfRcqPuBqvX/8Jc9URjEgkKOwcc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014