UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1XsCiUxZo+oUmne+tGBkBINi3XOXq0qeTWBIzjkxhKk=' 
WHERE 
  key_id = 'e375d3abb0a6ef64e9e748908e6ce5492e04da6f16bd6f54a2bb4a7d06fc7b6d' 
  AND (
    token = '1XsCiUxZo+oUmne+tGBkBINi3XOXq0qeTWBIzjkxhKk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00078