UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GQ59Ev1M0uN9V9byrav6HKTR+gemCXRu05mh9gZd8GE=' 
WHERE 
  key_id = 'a15c596b6228ed01a954ae3adc1c0d4cc0643dbfc827818e7aea98bfdefc55cd' 
  AND (
    token = 'GQ59Ev1M0uN9V9byrav6HKTR+gemCXRu05mh9gZd8GE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024