UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2soFSXH9zmNxmsSS5sqVr3AB2u599RVl0ZJNHxsZn8w=' 
WHERE 
  key_id = '360fcba67928d986e7d3830df49ef6fe7884869683770344dca3d08084370076' 
  AND (
    token = '2soFSXH9zmNxmsSS5sqVr3AB2u599RVl0ZJNHxsZn8w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029