UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ElwkgD1WH/a8W2DQlHwc2xtkr8colGfCJvg0wspi0kQ=' 
WHERE 
  key_id = '9fd0b002a341f6e600eef2d5a84cc50120d51434abfb15ef5a916515c0e893cb' 
  AND (
    token = 'ElwkgD1WH/a8W2DQlHwc2xtkr8colGfCJvg0wspi0kQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037