UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zbDcaQAZQNYPATsh3+EZW4HUY7BBVfFDrJQQMDQOOWE=' 
WHERE 
  key_id = 'aeca6faf7bc1432b562fe64e979a4f134f9a4266a19409ac3411b720fff1703c' 
  AND (
    token = 'zbDcaQAZQNYPATsh3+EZW4HUY7BBVfFDrJQQMDQOOWE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034