UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yiYQr/ZfI347emlpZckg3kMTaqcfk+Z3Qr7SeEJFvSU=' 
WHERE 
  key_id = '94fc888289785e1f31fa64e68510019d5f2a985917c5afb926ba28dd1e2e4f26' 
  AND (
    token = 'yiYQr/ZfI347emlpZckg3kMTaqcfk+Z3Qr7SeEJFvSU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033