UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kdxqVbk76/xRDvfD1yqPL+feiywdl598jTM81IJ0EtM=' 
WHERE 
  key_id = '592ba8202848fb31fd626c6e4a8a48a4c4cda78d59b7a7044e86cfb1f8945604' 
  AND (
    token = 'kdxqVbk76/xRDvfD1yqPL+feiywdl598jTM81IJ0EtM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029