UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LFMXwlCE3GN4t+oLIvkFOs+YxSj1/EYrpjdvN5fXb94=' 
WHERE 
  key_id = 'e047ab658ba6d18009a01de114c06750a93f43ab6b74924b0a60a37f8c98e3df' 
  AND (
    token = 'LFMXwlCE3GN4t+oLIvkFOs+YxSj1/EYrpjdvN5fXb94=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038