UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ki2xvlaHmmZj9iPSSQy11ngYjs5V+/9tA+spiTwDCmo=' 
WHERE 
  key_id = 'a94a35d89f5b06c38d29d8cb6674d5335a23ad3a4b6b772e1cda674cf30c06dd' 
  AND (
    token = 'Ki2xvlaHmmZj9iPSSQy11ngYjs5V+/9tA+spiTwDCmo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020