UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3JQOYg6onBGnaDEeS8evWIoglhlGSfHI+BN3PyYb1dY=' 
WHERE 
  key_id = '126a7ceaa69786048484a7f853a2a0017d17b2bb124bc7e4fc2549c8941eb152' 
  AND (
    token = '3JQOYg6onBGnaDEeS8evWIoglhlGSfHI+BN3PyYb1dY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032