UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BCSC74oZBhazQscc2psg2ztIpjbzp0/ycI94M3jiri0=' 
WHERE 
  key_id = '1983223be3f023f4e60d6b2131f38580235d8c2bf7868f1d87bd67f3f1b2f8ab' 
  AND (
    token = 'BCSC74oZBhazQscc2psg2ztIpjbzp0/ycI94M3jiri0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039