UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D1T9HDtHxU3t3t3gkUXGovLDwJ4aCVVjLLkRzR71yA8=' 
WHERE 
  key_id = '734ead0641f957b8cadc31b923ea9cd2c8a6e64e19bf2db4a892a8ffbf3b5529' 
  AND (
    token = 'D1T9HDtHxU3t3t3gkUXGovLDwJ4aCVVjLLkRzR71yA8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033