UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pS3skZby0jeddJScb2JUIX6/lE29CpdJhEx9VljuzpY=' 
WHERE 
  key_id = '0d9cb544694698ac0178015098bd2678cccaa7bb7692d6422e6bee4164d3e547' 
  AND (
    token = 'pS3skZby0jeddJScb2JUIX6/lE29CpdJhEx9VljuzpY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030