UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Vf8aA01zlNma+vf4u4uSPG6nBDYi82M53hTKWKegsts=' 
WHERE 
  key_id = '621b4a77fa7868a65b9487ebd81b40886e2b13c66cd780bfcf61ed45d8d12ca4' 
  AND (
    token = 'Vf8aA01zlNma+vf4u4uSPG6nBDYi82M53hTKWKegsts=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049