UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VCyE0igVnMheexhftdxAn3z5wXYg3ruTTYFFQTpgZCQ=' 
WHERE 
  key_id = '8ff900b0bfe82d17fa4a1ed465651f8d3c056ffd2d3152625240891e02e66c9b' 
  AND (
    token = 'VCyE0igVnMheexhftdxAn3z5wXYg3ruTTYFFQTpgZCQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025