UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DE+4LMvCgxOMwmWpkAOOYdOZyc17WNXk8pODq0Tae3g=' 
WHERE 
  key_id = '16fc9772367e69c40925f0c182217fc13eedc87a3fbfb481c7c26926423c330c' 
  AND (
    token = 'DE+4LMvCgxOMwmWpkAOOYdOZyc17WNXk8pODq0Tae3g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034