UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sfJ8bRof12PUBQPZiGJdfWVYa9f+k8SQydhjDszUjLg=' 
WHERE 
  key_id = 'e8c1c5cd1eb96ebd10d63ecc01f963b33f27ab27c3fe339aa822b6fb1859f4bc' 
  AND (
    token = 'sfJ8bRof12PUBQPZiGJdfWVYa9f+k8SQydhjDszUjLg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026