UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wUxNp3LIB+7vXe76vbowRpJLDyPrNX4oG7+SA4EJJ9k=' 
WHERE 
  key_id = '45b08ca1e78f8ad573fceb6563b6bd74fcff333b4f1af0e427475c15095a4c2a' 
  AND (
    token = 'wUxNp3LIB+7vXe76vbowRpJLDyPrNX4oG7+SA4EJJ9k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036