UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'd5DI+7gRjc6HT/D7sRx5jhZipBAvlKW4TFxYGwa5SiA=' 
WHERE 
  key_id = '581187aa8daf0b6ca8cffe847ed0e7f86e0c95a801dded7118c0f6208fa82b42' 
  AND (
    token = 'd5DI+7gRjc6HT/D7sRx5jhZipBAvlKW4TFxYGwa5SiA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00068