UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u0fM+WXAObN57VIPDUB3PfXTx2OOG8uYlykdzg0bmDo=' 
WHERE 
  key_id = '131088337a2b7f0ece8f42d202cae8cf7d6046267a12470fa7b2f3e719315d4d' 
  AND (
    token = 'u0fM+WXAObN57VIPDUB3PfXTx2OOG8uYlykdzg0bmDo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042