UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3yrtn7GlSwkkQPbzGFFWpf1fGcdPMFLoqRDKxOPuthA=' 
WHERE 
  key_id = 'fdeccb57972c8fad443f1653122fd701bd13c32162417a01838610b7fca2a384' 
  AND (
    token = '3yrtn7GlSwkkQPbzGFFWpf1fGcdPMFLoqRDKxOPuthA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030