UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IuwOhZOOG2u5zPMCpla0OvcXkDWjgMM5ayP+yLRfXvU=' 
WHERE 
  key_id = 'efd28c5f8c09fab32eeef09de6987f2d3da7e020cb9c4d7c24f03b11baa468ec' 
  AND (
    token = 'IuwOhZOOG2u5zPMCpla0OvcXkDWjgMM5ayP+yLRfXvU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050