UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uKN7Ybcx6JVPKypTUIpnIrrSC6QR54yhZXqKTPJzqO8=' 
WHERE 
  key_id = '6649a51cc8007dd5f39a8b08bb85e5cd4fa30bbdc241bc731c982e43ddcc15fc' 
  AND (
    token = 'uKN7Ybcx6JVPKypTUIpnIrrSC6QR54yhZXqKTPJzqO8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024