UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8aAg+FwbThk5EZ8+UV5EScrWGgN8UzStsMPmZN2ZTNs=' 
WHERE 
  key_id = '1572f56b141bd7ed1b85f185531b56f7797570eae292f77702aaa8aa363288b4' 
  AND (
    token = '8aAg+FwbThk5EZ8+UV5EScrWGgN8UzStsMPmZN2ZTNs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016